package gjtx7;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Scanner;

public class CutText {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.println("输入一个源文件名:");
        String str=in.nextLine();
        System.out.println("输入一个文件夹名：");
        String str1=in.next();
        File f=new File(str);
        try {
            FileInputStream fin=new FileInputStream(f);
            FileOutputStream out=new FileOutputStream(str1+"/"+f.getName(),true);
            byte[] b=new byte[fin.available()];
            int i=fin.read(b);
            out.write(b,0,i);
            out.close();
            fin.close();
            f.delete();
            System.out.println("剪切成功！");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
